<?php
	include_once('auth.php');
		
	include_once('config.php');
	
	if (!empty($_POST))
	{
		$content = $_POST['contacts'];
		
		file_put_contents('inst/contacts.txt', stripslashes($content));
		
		echo '<script>alert("Изменения сохранены");</script>';
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
	<head>
		<title>weZze-admin</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
        <link rel="shortcut icon" href="/favicon.ico" />
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="screen" />
        <script type = "text/javascript" src = "http://code.jquery.com/jquery-1.7.2.js"></script>
        <script type = "text/javascript" src = "js/script.js"></script>
        <script type = "text/javascript" src = "js/bootstrap.min.js"></script>
        <script type = "text/javascript" src = "js/tipsy.js"></script>
		
		<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

		<script type="text/javascript">
			tinyMCE.init({
					theme : "advanced",
					mode : "textareas",
					plugins : "fullpage",
					theme_advanced_buttons3_add : "fullpage",
					language: 'ru',
					content_css : "tinymce/style.css",
			});
		</script>
	</head>
	<body>
		<div class = "row-fluid show-grid logoutButton">
			<div class = "span1 offset11"><a href = "?do=logout"><span class="label label-info">Выйти</span></a></div>
		</div>
		<h3>КОНТАКТЫ</h3>
		<form method="post" action="">
				<p>     
						<textarea name="contacts" cols="50" rows="28" style = "width: 1024px;">
							<?php if (file_exists('inst/contacts.txt')) echo htmlkarakter(file_get_contents('inst/contacts.txt')); ?>
						</textarea>
				</p>
				<p>
						<input type="submit" value="Сохранить" />
				</p>
		</form>

	</body>
</html>